function hashFunc(str, size) {
  let hashCode = 0
  for (let i = 0; i < str.length; ++i) {
    hashCode = 37 * hashCode + str.charCodeAt(i)
  }
  return hashCode % size
}
console.log(hashFunc('aaa', 6))
console.log(hashFunc('bbb', 6))
console.log(hashFunc('cccz', 6))
